import Vue from 'vue'
import App from './App'
import store from './store/index'


import NoData from './components/no_data';
import PullUpLoading from './components/pull-up-loading';
import CheckBox from './components/checkbox';
import Skeleton from './components/skeleton';
import navigationBar from './components/navigationBar';
import tabBar from './components/tabBar';
import tmtCalendar from './components/tmt-calendar'

// import moment from 'moment' // 时间日期转换

// Vue.filter('dateformat', function(dataStr, pattern) {
//   return moment(dataStr).format(pattern)
// })

/** 全局组件引入 */
Vue.component('ui-no-data', NoData);//暂无数据
Vue.component('ui-pull-up-loading', PullUpLoading);//上拉加载
Vue.component('ui-checkbox', CheckBox);
Vue.component('ui-skeleton', Skeleton);//骨架屏
Vue.component('ui-navigation-Bar', navigationBar);//导航
Vue.component('ui-tab-bar', tabBar);//底部
Vue.component('ui-tmt-calendar',tmtCalendar)// 日历

Vue.config.productionTip = false
App.mpType = 'app'
// Vue.use(api)
Vue.prototype.$store=store;

// 提示
Vue.prototype.$toast = (msg, duration = 1500) => {
    wx.showToast({
      icon: 'none',
      title: msg,
      duration,
    }); 
}

// 提示
Vue.prototype.$showLoading = (msg) => {
  wx.showLoading({
    icon: 'none',
    title: msg,
  }); 
}

const app = new Vue(App)
app.$mount()
